﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Platform.Storage.Redis.Messages
{
	public class Int32RedisMessage : RedisMessageBase<Int32>
	{
		public Int32RedisMessage( RedisMessageChannel channel, string command, string[] parameters )
			: base( channel, command, parameters )
		{ }

		protected override int GetReply( Func<RedisReplyLine> nextLine )
		{
			var line = nextLine();

			if ( line.Reply == RedisReplyStatus.Number )
				return Convert.ToInt32( line.Message );
			else
				return default( int );
		}
	}
}
